<?php echo $this->element('navigation'); ?>

<div class="orders index">
	<h2><?php __('Your Orders');?></h2>
	
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('status'); ?></th>
			<th><?php echo $this->Paginator->sort('Author', 'publication_author'); ?></th>
			<th><?php echo $this->Paginator->sort('Title', 'publication_title'); ?></th>
			<th><?php echo $this->Paginator->sort('created'); ?></th>
			<th class="actions"><?php __('Actions');?></th>
	</tr>
	
	<?php
	$i = 0;
	foreach ($orders as $order):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $order['Order']['status']; ?></td>
		<td><?php echo $order['Order']['publication_author']; ?></td>
		<td><?php echo $order['Order']['publication_title']; ?></td>
		<td><?php echo $order['Order']['created']; ?></td>
		<td class="actions">
		<?php
			echo $this->Html->link(
				__('View', true), array('action' => 'view', $order['Order']['id']));
		?>
		</td>
	</tr>
	<?php
	endforeach;
	?>

	</table>
	
	<p>
	<?php
	echo $this->Paginator->counter(array(
		'format' => __('Page %page% of %pages%, showing %current% records out of %count%
			total, starting on record %start%, ending on %end%', true)));
	?>
	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev(
			'<< ' . __('previous', true), array(), null, array('class'=>'disabled'));
		echo " | ";
		echo $this->Paginator->numbers();
		echo " | ";
		echo $this->Paginator->next(
			__('next', true) . ' >>', array(), null, array('class' => 'disabled'));
	?>
	</div>
</div>
